function loginAndVarify() {
    var userID = $("#userID").val().trim()
    var password = $("#password").val().trim()

    if (userID.length === 20 || userID.length === 11 || userID.length === 18) {
        if(password.length === 0) {
            alert("密码不能为空")
        }else{
            var data = {
                userID: userID,
                password:md5(password)
            }
            $.ajax({
                async:true,
                url:"/verifyLogin",
                data:JSON.stringify(data),
                contentType: "application/json;charset=utf-8",
                dataType:"json",
                type:"post",
                success:function(response) {
                    console.log(response)
                    if (response["code"] === "200") {
                        var uId = response['user']['uId']
                        var name = response['user']['name']
                        var idCard = response['user']['idCard']
                        var phoneNum = response['user']['phoneNumber']
                        var email = response['user']['email']
                        window.location.href="/user?uId="+uId
                    }else if(response["code"] === "400"){
                        alert(response["msg"])
                    }
                },
                error:function(){
                    alert("服务器出现错误,请稍后再试")
                }
            })
        }
    }else{
        alert("用户名输入不符合规范")
    }

}

function register() {
    window.location.href="/register"
}